package cn.mw.cmdb.processor;

import cn.mw.cmdb.enums.ModelViewTypeEnum;
import cn.mw.cmdb.viewProcessor.ModelViewCabinetProcess;
import cn.mw.cmdb.viewProcessor.ModelViewDefaultProcess;
import cn.mw.cmdb.viewProcessor.ModelViewRoomProcess;
import cn.mw.cmdb.viewProcessor.ModelViewUNumProcess;

public class ModelViewTypeFactory {
    public static ModelViewTypeProccessor build(ModelViewTypeEnum viewTypeEnum) {
        ModelViewTypeProccessor proccessor = null;
        if (viewTypeEnum == null) {
            return new ModelViewDefaultProcess();
        } else {
            switch (viewTypeEnum) {
                case roomView:
                    proccessor = new ModelViewRoomProcess();
                    break;
                case cabinetView:
                    proccessor = new ModelViewCabinetProcess();
                    break;
                case UNumView:
                    proccessor = new ModelViewUNumProcess();
                    break;
                default:
                    proccessor = new ModelViewDefaultProcess();
                    break;
            }
        }
        return proccessor;
    }

}
